//package com.example.demo.utils;
//
//import guru.nidi.graphviz.engine.Format;
//import guru.nidi.graphviz.engine.Graphviz;
//import guru.nidi.graphviz.model.Graph;
//import guru.nidi.graphviz.model.MutableGraph;
//import guru.nidi.graphviz.parse.Parser;
//
//import java.io.File;
//import java.io.IOException;
//import java.util.Map;
//import java.util.Set;
//
//
//import static guru.nidi.graphviz.model.Factory.*;
//
//
//public class GraphvizUtils {
//    public static void generateGraph(Map<String, Map<String, Set<String>>> dependencies, String outputPath, String title) throws IOException {
//        MutableGraph g = mutGraph(title).setDirected(true);
//        dependencies.forEach((className, methods) -> {
//            methods.forEach((methodName, methodDependencies) -> {
//                methodDependencies.forEach(dependency -> {
//                    g.add(mutNode(className + "." + methodName).addLink(dependency));
//                });
//            });
//        });
//
//        Graphviz.fromGraph(g).width(700).render(Format.PNG).toFile(new File(outputPath));
//    }
//
//}
